<div class="top_col clearfix">
    <h4 class="title_col50"><?php echo $datasub->title; ?></h4>
</div>
<div class="main-col30">
        <ul class="clearfix">
            <li>Bài test</li>
            <li>
                        <?php $this->db->like('sub_test',$datasub->id);
                              $check_test2 = $this->common_model->getone('users',array('id'=>$this->session->userdata('id')));
                              if(!empty($check_test2))
                              {
                         ?>
                        <i class="icon-check-sign icon-2x" style="color: green;"></i>
            <?php } else { echo '<i class="icon-remove-sign icon-2x" style="color: red;"></i>';} ?>
            </li>
            <li><i class="icon-question"></i></li>
        </ul>
        <ul class="clearfix">
            <li>Status</li>
            <li><a href="javascript://" class="ajax_xoa" action="xoamonhoc"><i class="icon-check"></i>Delete</a></li>
            <li><i class="icon-question"></i></li>
        </ul>
        <ul class="clearfix">
            <li>Làm bài test</li>
            <li><a href="<?php echo base_url().'bai-test/'.$datasub->alias.'.html'; ?>">Take Test</a></li>
        </ul>
    <textarea name="content_des" id="content_sub" placeholder="Nhập mô tả kinh nghiệm cho môn học của bạn" style="width: 98%;border:1px solid #ccc; height:100px;margin:15px 0px;"><?php if(!empty($dessub)) { echo $dessub->description; } ?></textarea>
    <div class="node_ajax">
    </div>
    <div class="loading" style="display: none;">
        <i class="icon-spinner icon-spin icon-large"></i> Đang tải dữ liệu vui lòng đợi ...
    </div>
    <input id="idmon" type="hidden" value="<?php echo $datasub->id; ?>" name="idmon" />
    <a href="javascript:void(0);" class="btn_view updatedata" style="color: #fff;" >Lưu</a>
<script>
                        $(document).ready(function(){
                            $('.updatedata').on('click',function(){
                               var content_des =$('#content_sub').val();
                               var idmon = $('#idmon').val();
                               $('.loading').fadeIn();
                               $.ajax({
                                      type: "POST",
                                      url: '<?php echo base_url(); ?>ajax/update_mon',
                                      data: {
                                        content_des : content_des,
                                        idmon:idmon
                                        },
                                      success: success
                                    });
                            });
                            function success(data,status){
                                        $('.loading').fadeOut();
                                        window.location.reload();
                                   };
                        });
                </script>
<script>
        	$(document).ready(function() {
    		$('.ajax_xoa').click(function() {
    		  var idmon = $('#idmon').val();
              var action = $(this).attr('action');
                 $.ajax({
                          type: "POST",
                          url: '<?php echo base_url(); ?>ajax/xoamonhoc',
                          data: {
                            action : action,
                            idmon :idmon
                            },
                          success: success
                        });
    		});
            function success(data,status){
                window.location.reload();
               };
    	});
</script>
</div>